<meta charset="UTF-8">
<div class="sidebar-scroll">
	<div id="sidebar" class="nav-collapse collapse">
		<div class="navbar-inverse">
			<form class="navbar-search visible-phone">
				<input type="text" class="search-query" placeholder="Search" />
			</form>
		</div>
		<ul class="sidebar-menu">

			<li class="sub-menu" th:each="p:${session.list}"><a
				href="javascript:;" class=""> <i class="icon-eye-open"></i> <span
					th:text="${p.permissionName}"></span> <span class="arrow"></span>
			</a>
				<ul class="sub">
					<li th:each="p2:${p.secondPermission}"><a
						th:id="el+${p2.permissionId}" class=""
						th:href="@{${p2.permissionUrl}(nav=el+${p2.permissionId})}"
						th:text="${p2.permissionName}"></a></li>
				</ul></li>



		</ul>
	</div>
</div>

<script type="text/javascript">
	//获取url中的参数
	function getUrlParam(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
		var r = window.location.search.substr(1).match(reg); //匹配目标参数
		if (r != null)
			return unescape(r[2]);
		return null; //返回参数值
	}
	/*
	 *设置导航选中
	 */
	window.onload = function() {
		var nav = getUrlParam("nav"); 
		$("#" + nav).css("color", "red");
		$("#" + nav).parent().parent().attr("style", "display:block");
		$("#" + nav).parent().parent().parent().addClass("open");
	}
</script>